//
//  NickNameCell.m
//  PropertyMananger
//
//  Created by bh on 16/12/30.
//  Copyright © 2016年 BH. All rights reserved.
//

#import "NickNameCell.h"

@implementation NickNameCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
+ (instancetype)cellWithTableView:(UITableView *)tableView
{
    static NSString *cellID = @"NickNameCellID";
    NickNameCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    if(cell == nil) {
        cell = [[NickNameCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
    }
    //选中cell的颜色 -无色
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    
    return cell;

}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{

    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.headerImg = [[UIImageView alloc]init];
        [self.contentView addSubview:self.headerImg];
        self.headerImg.image = IMG(@"ico_mail_list_property");
        
        [self.headerImg mas_makeConstraints:^(MASConstraintMaker *make) {
            make.leading.equalTo(self).with.offset(15);
            make.centerY.equalTo(self).with.offset(0);
            make.size.mas_equalTo(CGSizeMake(40, 40));
        }];
        
        self.nickNameLabel = [[UILabel alloc]init];
        [self.contentView addSubview:self.nickNameLabel];
        self.nickNameLabel.textColor = BHColor(51, 51, 51);
        // self.nickNameLabel.backgroundColor = BHRandColor;
        
        self.nickNameLabel.textAlignment = NSTextAlignmentLeft;
        self.nickNameLabel.font = BHFont(15);
        self.nickNameLabel.text = @"白小白";
        
        [self.nickNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.leading.equalTo(self.headerImg.mas_trailing).with.offset(15);
            make.top.equalTo(self.headerImg).with.offset(-5);
            make.size.mas_equalTo(CGSizeMake(BHscreenW/2, 25));
        }];
        
        self.subNameLabel = [[UILabel alloc]init];
        [self.contentView addSubview:self.subNameLabel];
        
        self.subNameLabel.textColor = BHColor(102, 102, 102);
        self.subNameLabel.textAlignment = NSTextAlignmentLeft;
        self.subNameLabel.font = BHFont(13);
        
        self.subNameLabel.text = @"物业经理";
        [self.subNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.leading.equalTo(self.nickNameLabel).with.offset(0);
            make.top.equalTo(self.nickNameLabel.mas_bottom).with.offset(0);
            make.size.mas_equalTo(CGSizeMake(120, 25));
        }];
        
        
    }
    return self;


}
@end
